package br.com.controller;

import java.sql.Connection;
import java.util.List;

import br.com.bean.BimestreBean;
import br.com.dao.BimestreDao;

public class BimestreController {

	public static void inserir(Connection conn, String bimestre) throws Exception{
		
		BimestreBean bim = new BimestreBean();
	    bim.setBimestre(bimestre);
		
	    BimestreDao dao = new BimestreDao();
		dao.inserir(conn,bim);
	}
	
	
	public static void excluir(Connection conn, int id) throws Exception{
		
		BimestreBean bim = new BimestreBean();
	    bim.setId(id);
		
	    BimestreDao dao = new BimestreDao();
		dao.excluir(conn,bim);
	}
	
	public static void update(Connection conn, String bimestre, int id) throws Exception{
		
		BimestreBean bim = new BimestreBean();
	    bim.setId(id);
	    bim.setBimestre(bimestre);
	   
	    
	    BimestreDao dao = new BimestreDao();
		dao.alterar(conn,bim);
}
	
	public static List<BimestreBean> ListBimestre(Connection conn) throws Exception{
		
		BimestreDao dao = new BimestreDao();
		List<BimestreBean> bimestreList = dao.getLista(conn);
		
		return bimestreList;

	}		
}